<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use think\Request;
class System extends Base
{
	/**
	 * 系统设置
	 * @Author   Jenick
	 * @DateTime 2018-06-27T22:36:30+0800
	 * @return   [type]                   [description]
	 */
    public function index()
    {
    	$data = Db::name('system')
    			->where('id','=',0)
    			->find();
        return $this->fetch('',$data);
    }
    
    public function website(Request $request)
    {
    	if($request->isPost()){
    		$data = $request->post();
    		$res = Db::name('system')
    				->where('id','=',0)
    				->update($data);
    		if($res){
    			return getJson(0,'更新成功');
    		}
    		return getJson(1,'更新失败');
    	}
    }
}